import java.math.BigInteger;
import java.util.Scanner;

public class CANDY3 {
	public static void main (String args[]) {
		Scanner in = new Scanner(System.in);
		//Enter number of testcases
		int testcases = in.nextInt();
		while (testcases-- > 0) {
			int numKids = in.nextInt();
			BigInteger sum = BigInteger.ZERO;
			for (int i = 0; i < numKids; i++) {
				sum = sum.add(in.nextBigInteger());
			}
			System.out.println(sum.mod(new BigInteger(Integer.toString(numKids))).equals(BigInteger.ZERO)?"YES":"NO");
 		}
	}
}